﻿package app.controller {
    
	import app.model.types.LangTypes;
	import app.model.types.SectionType;
	import app.model.vo.SectionVO;
    import flash.display.DisplayObject;
    
    import org.puremvc.interfaces.*;
    import org.puremvc.patterns.command.*;
    import org.puremvc.patterns.observer.*;
    
    import app.model.*;
    import app.view.ApplicationMediator;
    import app.ApplicationFacade;

    /**
     * Create and register proxies and mediators
     */
    public class StartSiteCommand extends SimpleCommand
    {
        override public function execute( note:INotification ) :void    
        {
			// получаем контент для дефолтной секции
			//var defaultID:String = SectionType.PAGE_EXPO_STRUCTURE_EXPOSITIONS;
			var defaultID:String = SectionType.PAGE_MAIN;
			//trace(defaultID);
			var defaultSectionContent:Object = remote.getSectionContent(defaultID, LangTypes.DEFAULT);
			var sectionVO:SectionVO = new SectionVO();
			sectionVO.data = defaultSectionContent;
			sectionVO.id = defaultID;
			sendNotification(ApplicationFacade.CMD_CHANGE_SECTION, sectionVO);
			
		};
    };
};